package com.simple.cloud.controller;

import com.simple.cloud.pojo.Dept;
import com.simple.cloud.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <h3>springcloud</h3>
 * <p></p>
 *
 * @author : 你的名字
 * @date : 2020-05-19 14:47
 **/
@RestController
@RequestMapping("/consumer")
public class DeptConsumerController {

    @Autowired
    private DeptClientService clientService = null;

    @GetMapping("/get/{id}")
    public Dept get(@PathVariable("id") Long id) {
        return clientService.queryById(id);
    }

    @PostMapping("/add")
    public Boolean add(Dept dept) {
        return clientService.addDept(dept);
    }

    @GetMapping("/get/list")
    public List<Dept> getList() {
        return clientService.queryAll();
    }


}
